<script setup lang="ts">
import {onLaunch, onShow, onHide} from "@dcloudio/uni-app";
import {getCurrentInstance} from 'vue'

onLaunch(() => {
  console.log("App Launch");
  uni.getSystemInfo({
    success: function (e) {
      // 获取 appContext  上下文
      const {appContext} = getCurrentInstance()
      console.log('StatusBar', appContext)
      // #ifndef MP
      appContext.config.globalProperties.StatusBar = e.statusBarHeight;
      if (e.platform == 'android') {
        appContext.config.globalProperties.CustomBar = e.statusBarHeight + 50;
      } else {
        appContext.config.globalProperties.CustomBar = e.statusBarHeight + 45;
      }

      // #endif


      // #ifdef MP-WEIXIN
      appContext.config.globalProperties.StatusBar = e.statusBarHeight;
      let custom = wx.getMenuButtonBoundingClientRect();
      appContext.config.globalProperties.Custom = custom;
      appContext.config.globalProperties.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
      console.log(appContext)
      // #endif
      // #ifdef MP-ALIPAY
      appContext.config.globalProperties.StatusBar = e.statusBarHeight;
      appContext.config.globalProperties.CustomBar = e.statusBarHeight + e.titleBarHeight;
      // #endif
    }
  })
});
onShow(() => {
  console.log("App Show");
});
onHide(() => {
  console.log("App Hide");
});
</script>
<style lang="scss">
@import "./colorui/main.css";
@import "./colorui/icon.css";
@import 'uni-nutui/components/sky-nutui/app.scss';
@import '@vusui/editor/lib/style.css';

.ql-image {
  height: 30px;
}

.ql-image:after {
  content: "图片" !important;
}

page {
  background-color: #F8F9FB;

}

uni-toast {
  z-index: 999999;
}


.text-background {
  color: rgba(0, 0, 0, 0.25);
}

.text-title {
  min-width: 100px;
  font-size: 18px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.85);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.text-black-primary {
  min-width: 100px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.85);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.text-gray-primary {
  min-width: 100px;
  //font-size: 20px;
  color: #666;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.text-666 {
  min-width: 100px;
  //font-size: 20px;
  color: #666;
  display: -webkit-box;

}


.text-back {
  margin: 0;
  color: rgba(0, 0, 0, 0.25);
  -webkit-tap-highlight-color: transparent;
}

.bg-primary {
  background-color: #F8F9FB;
}

.text-primary {
  color: $primary-color;

}

.bg-loading {
  background-color: #F8F9FE;
}

.radius-sm {
  border-radius: 20upx

}

.no-padding {
  padding: 0;
}

.no-margin {
  margin: 0 auto;
}

.box-shadow {
  border-radius: 20upx;
  box-shadow: 0px 1px 7px 0px rgb(237 238 241);
}

.shadow-primary {
  box-shadow: 0px 1px 7px 0px rgb(237 238 241);

}

.radius-top {
  border-radius: 20upx 20upx 0 0;

}


.radius-bottom {
  border-radius: 0 0 20upx 20upx;

}

.radius-xs {
  border-radius: 20upx 20upx 20upx 20upx;

}


.footer {
  background: #FFFFFF;
  padding: 15px;
  position: fixed;
  bottom: 0;
  width: 100%;
}

.header {
  background: #FFFFFF;
  //padding: 15px;
  position: fixed;
  top: 0;
  width: 100%;
}

.text-warp-2 {
  display: -webkit-box !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

</style>
